﻿$(document).ready(function () {

    window.top.$navigator = {};
    window.top.ngW8.$events.$onCreateNewScope(function (scope) {
        scope.$dateToString = function (data, format) {
            if (!format)
                format = "dd/MM/yyyy"
            return ngW8.$("$filter")("date")(data, format);
        }
        scope.$cloneData = function (data) {
            return Function('', 'return ' + JSON.stringify(data))();
        }
        if (scope.$$$path == "/hubpage/hubpage_sub.html") {
            //dat lai de lay dung language
            scope.$$$templatePath = "ms-appx:////pages//hubpage/hubpage.html";
            window.$navigator.form = undefined;
        }

        ngW8.$("$application").$setCurrentScope(scope);
        /*Trước khi template hiển thị, phải nạp ngôn ngữ từ Web service*/
        ngW8.$("$wslang").$apply(scope, function (sender) {
            applyGlobalResource(scope);
            sender.$$$done();

        });
    });
    ngW8.$setRootTemplatePath("ms-appx:////pages/")
    ngW8.start($("body")[0], "main.html", ['angular-gestures'], function () {
        
       
    });
});